#define OK 0
#define ERROR 1
#include<stdio.h>
#include<stdlib.h>
typedef struct stack
{
	int top;
	int a[10];
}Stack;
void Create(Stack *s)
{
	s->top=-1;
}
int Push(Stack *s,int x)
{
	s->top++;
	s->a[s->top]=x;
	return OK;
}
void DisplayStack(Stack *s)
{
	int n=s->top;
	while(n!=-1)
	{
		printf("%6d",s->a[n]);
		n--;
	}
}
int main()
{
	Stack s;
	int i;
	Create(&s);
	for(i=0;i<10;i++)
		Push(&s,i*i);
	DisplayStack(&s);
	printf("\nlength=%d\n",s.top+1);
	printf("\nThe End!\n");
	return 0;
}
